home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 127 / PC Guia 127.iso / Software / Utils / GParted Live CD / Bin / gparted-livecd-0.2.2.iso / usr_sqfs / bin / xslt-config < prev    next >
Encoding:
Text File  |  2005-09-11  |  2.2 KB  |  132 lines

  1. #! /bin/sh
  2.  
  3. prefix=/usr
  4. exec_prefix=${prefix}
  5. exec_prefix_set=no
  6. includedir=${prefix}/include
  7. libdir=${exec_prefix}/lib
  8.  
  9. usage()
  10. {
  11.     cat <<EOF
  12. Usage: xslt-config [OPTION]...
  13.  
  14. Known values for OPTION are:
  15.  
  16.   --prefix=DIR        change XSLT prefix [default $prefix]
  17.   --exec-prefix=DIR    change XSLT executable prefix [default $exec_prefix]
  18.   --libs        print library linking information
  19.   --cflags        print pre-processor and compiler flags
  20.   --help        display this help and exit
  21.   --version        output version information
  22. EOF
  23.  
  24.     exit $1
  25. }
  26.  
  27. if test $# -eq 0; then
  28.     usage 1
  29. fi
  30.  
  31. cflags=false
  32. libs=false
  33.  
  34. while test $# -gt 0; do
  35.     case "$1" in
  36.     -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  37.     *) optarg= ;;
  38.     esac
  39.  
  40.     case "$1" in
  41.     --prefix=*)
  42.     prefix=$optarg
  43.     if test $exec_prefix_set = no ; then
  44.         exec_prefix=$optarg
  45.     fi
  46.     ;;
  47.  
  48.     --prefix)
  49.     echo $prefix
  50.     ;;
  51.  
  52.     --exec-prefix=*)
  53.     exec_prefix=$optarg
  54.     exec_prefix_set=yes
  55.     ;;
  56.  
  57.     --exec-prefix)
  58.     echo $exec_prefix
  59.     ;;
  60.  
  61.     --version)
  62.     echo 1.1.15
  63.     exit 0
  64.     ;;
  65.  
  66.     --help)
  67.     usage 0
  68.     ;;
  69.  
  70.     --cflags)
  71.            cflags=true
  72.            ;;
  73.  
  74.     --libs)
  75.            libs=true
  76.            ;;
  77.  
  78.     *)
  79.     usage
  80.     exit 1
  81.     ;;
  82.     esac
  83.     shift
  84. done
  85.  
  86. the_libs="-L${libdir} -lxslt  -L/usr/lib -lxml2 -lz -lm -lm"
  87. if test "$includedir" != "/usr/include"; then
  88.     the_flags="$the_flags -I$includedir `xml2-config --cflags`"
  89. else
  90.     the_flags="$the_flags `xml2-config --cflags`"
  91. fi
  92.  
  93. if $cflags; then
  94.     all_flags="$the_flags"
  95. fi
  96.  
  97. if $libs; then
  98.     all_flags="$all_flags $services $the_libs"
  99. fi
  100.  
  101. if test -z "$all_flags" || test "x$all_flags" = "x "; then
  102.     exit 1
  103. fi
  104.  
  105. # Straight out any possible duplicates, but be careful to
  106. # get `-lfoo -lbar -lbaz' for `-lfoo -lbaz -lbar -lbaz'
  107. other_flags=
  108. rev_libs=
  109. for i in $all_flags; do
  110.     case "$i" in
  111.     # a library, save it for later, in reverse order
  112.     -l*) rev_libs="$i $rev_libs" ;;
  113.     *)
  114.     case " $other_flags " in
  115.     *\ $i\ *) ;;                # already there
  116.     *) other_flags="$other_flags $i" ;;    # add it to output
  117.         esac ;;
  118.     esac
  119. done
  120.  
  121. ord_libs=
  122. for i in $rev_libs; do
  123.     case " $ord_libs " in
  124.     *\ $i\ *) ;;            # already there
  125.     *) ord_libs="$i $ord_libs" ;;    # add it to output in reverse order
  126.     esac
  127. done
  128.  
  129. echo $other_flags $ord_libs
  130.  
  131. exit 0
  132.